home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Info-Mac 4
/
Info_Mac IV CD-ROM (Pacific HiTech Inc.)(August 1994).iso
/
Science
/
RLaB
/
help
/
SCALARS
< prev
next >
Wrap
Text File
|
1994-04-25
|
746b
|
32 lines
SCALAR:
In RLaB scalar numerics belong to the same class as matrix
numerics. Other than size, there is little distinction between
an array (matrix) of numbers, and a single number (scalar).
> a = 1
1
> b = 1+2*sqrt(2+a)
4.4641016
Scalars can have real, or complex numeric values (a real part,
and an imaginary part). A complex scalar is created by using a
complex constant. A complex constant is entered with either an
`i' or a `j' denoting the imaginary number...
12.5i
2j
No spaces are allowed between the number and the `i' or `j'.
So a complex variable can be created like:
a = 1.5 - 3j
You can also use the MATLAB approach...
i = sqrt(-1);
a = 1.5 - 3*i
See `help COMPLEX' for more info on complex variables.